//
//  Created by inno on 11/13/11.
//
// To change the template use AppCode | Preferences | File Templates.
//


#import "UrlBuilder.h"


@implementation UrlBuilder

- (void)addArgument:(NSString *)argument with:(NSString *)value {
    [arguments setObject:value forKey:argument];
}

- (NSString *)getUrl {
    NSMutableString *url = [NSMutableString new];
    [url appendString:[self baseUrl]];
    [url appendString:@"/scripts/mobile.php"];
    [url appendString:@"?action="];
    [url appendString:[self action]];
    for (NSString *argument in arguments) {
        [url appendString:argument];
        [url appendString:@"="];
        [url appendString:[arguments objectForKey:argument]];
    }
    return url;
}
@end